﻿Ext.define('Wiztop.controller.MyMeeting', {
    extend: 'Ext.app.Controller',
    requires: ['Wiztop.model.VoteItem'],
    config: {
        refs: {
            myMeetingView: {
                selector: 'mymeetingview',
                xtype: 'mymeetingview',
                autoCreate: true
            },
            myApproveView: '#myApproveView',
            commentList: '#commentList',
            myApproveList: '#myApproveList',
            myTopicList: '#myTopicList',
            myVideoList: '#myVideoList',
            btnBackHome: '#btnBackHome',
            btnTopicCollect: '#btnTopicCollect',
            myVoteResultList: '#myVoteResultList',
            myHistoryList: '#myHistoryList',
            hMyTitle: '#hMyTitle',
            hMyStart: '#hMyStart',
            hMyEnd: '#hMyEnd',
            btnMySearch: '#btnMySearch',
            btnUnSign: '#btnUnSign',
            btnSigned: '#btnSigned',
            mySummaryList: '#mySummaryList',
            btnUnSignSummary: '#btnUnSignSummary',
            btnSignedSummary: '#btnSignedSummary',
            segTopic: '#segTopic',
            segSummary: '#segSummary',
            videoList: '#videoList',
            txtTitle: '#txtTitle',
            employeeList: '#employeeList',
            segMain: '#segMain'
        },
        control: {
            myMeetingView: {
                activeitemchange: 'tab_activeitemchange'
            },
            commentList: {
                itemtap: 'comment_tap'
            },
            myApproveList: {
                itemtap: 'approve_tap'
            },
            mySummaryList: {
                itemtap: 'summary_tap'
            },
            myTopicList: {
                itemtap: 'topic_tap'
            },
            btnBackHome: {
                tap: 'backHome'
            },
            btnTopicCollect: {
                tap: 'toTopicCollect'
            },
            myVoteResultList: {
                itemtap: 'result_tap'
            },
            btnMySearch: {
                tap: 'mySearch'
            },
            myHistoryList: {
                itemtap: 'history_itemtap'
            },
            btnUnSign: {
                tap: "unsign_tap"
            },
            btnSigned: {
                tap: "signed_tap"
            },
            videoList: {
                itemtap: "video_itemtap"
            },
            '#btnCreateVideoMeeting': {
                tap: 'createVideo_tap'
            },
            btnUnSignSummary: { tap: 'unSignSummary_tap' },
            btnSignedSummary: { tap: 'signedSummary_tap' },
            '#btnMeetingTopic': { tap: 'toMeetingTopic' },
            '#btnMeetingSummary': { tap: 'toMeetingSummary' },
            '#btnCancelVideo': { tap: 'cancelVideo_tap' },
            '#btnSaveVideo': { tap: 'saveVideo_tap' }
        },
        routes: {
            'mymeeting': 'showMyMeetingView',
            'mymeeting/:repeat': 'showRepeatView'//是不是重复进入，如果是，界面不再刷新
        }
    },
    hostEmail: '', //主持人帐号
    hostPass: '', //主持人密码
    showRepeatView: function (repeat) {
        //显示视图
        Ext.Viewport.setActiveItem(this.getMyMeetingView());
        sessionStorage.LastView = "mymeeting/false";
        sessionStorage.CurrentView = "mymeeting/true";
        if (repeat == false) {
            //alert("repeat");
            this.getMyMeetingView().setActiveItem(2);
        }
        var activeItem = this.getMyMeetingView().getActiveItem();
        if (activeItem.id == 'myTopicList') {
            this.initTopicList();
        }
        else if (activeItem.id == 'myApproveView') {
            activeItem = this.getSegMain().getActiveItem();

            if (activeItem.getId() == 'btnMeetingTopic') {
                //
                activeItem = this.getSegTopic().getActiveItem();
                if (activeItem.getId() == 'btnUnSign') {
                    this.unsign_tap();
                }
                else {
                    this.signed_tap();
                }
            }
            else {
                //
                activeItem = this.getSegSummary().getActiveItem();
                if (activeItem.getId() == 'btnUnSignSummary') {
                    this.unSignSummary_tap();
                }
                else {
                    this.signedSummary_tap();
                }
            }
        }
        else if (activeItem.getId() == 'commentList') {
            this.initCommentList();
        }
    },
    showMyMeetingView: function () {
        //显示视图
        Ext.Viewport.setActiveItem(this.getMyMeetingView());
        sessionStorage.LastView = "mymeeting/false";
        sessionStorage.CurrentView = "mymeeting/false"
        this.getMyMeetingView().setActiveItem(2);
    },
    tab_activeitemchange: function (item, newvalue, oldvalue) {
        Ext.Viewport.mask({ xtype: 'myloadmask', message: '加载中' + commLib.loadingText });
        if (newvalue.getId() == 'commentList') {
            this.initCommentList();
        }
        else if (newvalue.getId() == 'myTopicList') {
            this.initTopicList();
        }
        else if (newvalue.getId() == 'myMeetingList') {
            //this.redirectTo("meetinghistory");
            this.mySearch();
        }
        else if (newvalue.getId() == 'myApproveView') {
            this.unsign_tap();
        }
        else if (newvalue.getId() == 'myVoteList') {
            //获取自己所参与的投票
            Ext.data.JsonP.request({
                url: commLib.Website + '/ashx/VoteHandler.ashx?method=getbyemployee&employeeId=' + sessionStorage.UserId,
                scope: this,
                success: function (result, request) {
                    if (result.success) {
                        var store = this.getMyVoteResultList().getStore();
                        store.removeAll();
                        store.setData(result.ResponseData);
                        Ext.Viewport.unmask();
                    }
                    else {
                        Ext.Viewport.unmask();
                        Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                        return false;
                    }
                }
            });
        }
        else if (newvalue.getId() == 'myVideoList') {
            this.getVideoMeeting();
        }
    },
    initCommentList: function () {
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/MeetingHandler.ashx?method=getcomment&id=' + sessionStorage.UserId,
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getCommentList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                    Ext.Viewport.unmask();
                }
                else {
                    Ext.Viewport.unmask();
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    initTopicList: function () {
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/TopicHandler.ashx?method=getmy&empId=' + sessionStorage.UserId,
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getMyTopicList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                    Ext.Viewport.unmask();
                }
                else {
                    Ext.Viewport.unmask();
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    comment_tap: function (dataview, index, item, record, e) {
        var me = this;
        var target = e.target;
        if (target.id == 'btnViewComment') {
            sessionStorage.MeetingId = record.raw.MeetingId;
            sessionStorage.CommentSrc =record.raw.URL;
            me.redirectTo("whiteboard/" + record.raw.Id + "/" + record.raw.Path + "/" + escape(record.raw.Name) + "/" + record.raw.PageCount);
        }
        else if (target.id == 'btnDeleteComment') {
            Ext.Msg.confirm('提示', '确定删除记事本吗?', function (button) {
                if (button == 'yes') {
                    Ext.data.JsonP.request({
                        url: commLib.Website + '/ashx/MeetingHandler.ashx',
                        params: {
                            method: 'delcomment',
                            commentId: record.raw.Id,
                            meetingId: record.raw.MeetingId,
                            path: record.raw.Path
                        },
                        success: function (result, request) {
                            if (result.success) {
                                me.getCommentList().getStore().removeAt(index);
                                Ext.Msg.alert('提示', '删除成功!');
                            }
                            else {
                                Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                            }
                        },
                        failure: function (response) {
                            Ext.Msg.alert('错误', '未知异常', Ext.emptyFn);
                        }
                    });
                }
            });
        }
    },
    approve_tap: function (dataview, index, item, record, e) {
        var target = e.target;
        if (target.id == 'enterTopic') {
            this.redirectTo("topicdetail/" + record.raw.Id + "/1");
        }
    },
    summary_tap: function (dataview, index, item, record, e) {
        var target = e.target;
        if (target.id == 'enterSummary') {
            this.redirectTo("summarydetail/" + record.raw.Id);
        }
    },
    topic_tap: function (dataview, index, item, record, e) {
        var me = this;
        var target = e.target;
        if (target.id == 'enterBtn') {
            //进入议题界面            
            this.redirectTo("topicdetail/" + record.raw.Id + "/0");
        }
        else if (target.id == 'btnDelTopic') {
            Ext.Msg.confirm('提示', '确定删除该议题吗?', function (button) {
                if (button == 'yes') {
                    Ext.Viewport.mask({ xtype: 'myloadmask', message: '正在删除中' + commLib.loadingText });
                    Ext.data.JsonP.request({
                        url: commLib.Website + '/ashx/TopicHandler.ashx',
                        params: {
                            method: 'deltopic',
                            topicId: record.raw.Id
                        },
                        success: function (result, request) {
                            Ext.Viewport.unmask();
                            if (result.success) {
                                me.getMyTopicList().getStore().removeAt(index);
                                Ext.Msg.alert('提示', '删除成功!');
                            }
                            else {
                                Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                            }
                        },
                        failure: function (response) {
                            Ext.Viewport.unmask();
                            Ext.Msg.alert('错误', '未知异常', Ext.emptyFn);
                        }
                    });
                }
            });
        }
        else if (target.id == 'btnEditTopic') {
            //进入议题编辑界面            
            this.redirectTo("topiccollect/" + record.raw.Id + "/" + record.raw.CategoryId);
        }
        else if (target.id == 'upApprove') {
            //            //进入上传呈批表界面            
            //            var upApprovePicker = Ext.getCmp('upApprovePicker');
            //            if (upApprovePicker) {
            //                if (upApprovePicker.getHidden()) {
            //                    upApprovePicker.show();
            //                }
            //                else {
            //                    upApprovePicker.hide();
            //                }
            //            }
            //            else {
            //                //生成上传呈批浮动面板
            //                upApprovePicker = new Ext.Panel(
            //                                {
            //                                    id: 'upApprovePicker',
            //                                    width: 400,
            //                                    height: 200,
            //                                    floating: true,
            //                                    modal: true,
            //                                    hideOnMaskTap: true,
            //                                    centered: true,
            //                                    style: 'background-color:transparent',
            //                                    layout: {
            //                                        type: 'vbox',
            //                                        align: 'stretch',
            //                                        pack: 'center'
            //                                    },
            //                                    items: [
            //                                    {
            //                                        xtype: 'textfield',
            //                                        label: '呈批表名称',
            //                                        id: 'txtApproveName',
            //                                        value: '议题呈批表',
            //                                        placeHolder: '请输入呈批表名称',
            //                                        required: true,
            //                                        clearIcon: true
            //                                    },
            //                                    {
            //                                        id: 'upApproveTable',
            //                                        xtype: 'fileupload',
            //                                        margin: 20,
            //                                        iconCls: 'download',
            //                                        iconMask: true,
            //                                        ui: 'confirm',
            //                                        text: '上传呈批表',
            //                                        actionUrl: commLib.Website + '/ashx/SaveFile.aspx?topicId=' + record.raw.Id + '&category=1',
            //                                        returnBase64Data: true
            //                                    }]
            //                                });
            //                //显示上传界面
            //                this.getMyMeetingView().add(upApprovePicker);
            //                upApprovePicker.show();
            //            }
        }
    },
    backHome: function () {
        this.redirectTo("home");
    },
    result_tap: function (dataview, index, item, record, e) {
        var me = this, target = e.target;
        if (target.id == 'btnViewResult') {
            if (record.raw.Category == 4) {
                //生成投票结果界面
                var voteResultOfficePanel = Ext.create('Ext.Panel', {
                    floating: true,
                    modal: true,
                    hideOnMaskTap: true,
                    centered: true,
                    height: 600,
                    width: 700,
                    style: 'background-color:transparent',
                    layout: 'fit',
                    items: [

                    {
                        docked: 'bottom',
                        xtype: 'toolbar',
                        layout: {
                            type: 'hbox',
                            pack: 'center'
                        },
                        items: [
                        {
                            text: '确定',
                            handler: function () {
                                voteResultOfficePanel.destroy();
                            }
                        }]
                    },
                    {
                        xtype: 'list',
                        id: 'resultOfficeList',
                        items: [
                        {
                            xtype: 'panel',
                            docked: 'top',
                            layout: 'hbox',
                            items: [
                            {
                                baseCls: 'title',
                                style: 'width:60%',
                                html: '打分项目'
                            },
                            {
                                baseCls: 'title',
                                style: 'width:10%',
                                html: '打分人数'
                            },
                            {
                                baseCls: 'title',
                                style: 'width:10%',
                                html: '最低分'
                            },
                            {
                                baseCls: 'title',
                                style: 'width:10%',
                                html: '最高分'
                            },
                             {
                                 baseCls: 'title',
                                 style: 'width:10%',
                                 html: '平均分'
                             }]
                        }],
                        emptyText: '<div class="emptyText">没有数据</div>',
                        itemTpl: '<div style="margin:0px auto;width:100%"><div style="width:60%;float:left;text-align: center;">{ItemName}</div><div style="width:10%;float:left;text-align: center;">{PeopleNumber}</div><div style="width:10%;float:left;text-align: center;">{ScoreMin}</div><div style="width:10%;float:left;text-align: center;">{ScoreMax}</div><div style="width:10%;float:right;text-align: center;">{ScoreAvg}</div></div>',
                        grouped: true,
                        store: new Ext.data.Store({
                            model: 'Wiztop.model.VoteResult_Office',
                            grouper: function (r) {
                                var category = r.raw.SubOfficeName;
                                return category;
                            },
                            autoLoad: false
                        })
                    }
                ]
                });
                Ext.Viewport.add(voteResultOfficePanel);
                //获取投票结果
                Ext.data.JsonP.request({
                    url: commLib.Website + '/ashx/VoteHandler.ashx?method=getresult_office&voteId=' + record.raw.Id + '&meetingId=' + record.raw.MeetingId,
                    success: function (result, request) {
                        if (result.success) {
                            var store = Ext.getCmp('resultOfficeList').getStore();
                            store.removeAll();
                            store.setData(result.ResponseData);
                            voteResultOfficePanel.show();
                        }
                        else {
                            Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                            return false;
                        }
                    }
                });
            }
            else {
                //生成投票结果界面
                var voteResultPanel = Ext.create('Ext.Panel', {
                    floating: true,
                    modal: true,
                    hideOnMaskTap: true,
                    centered: true,
                    height: 600,
                    width: 600,
                    layout: 'fit',
                    items: [
                {
                    docked: 'top',
                    xtype: 'toolbar',
                    title: '投票结果'
                },
                {
                    docked: 'bottom',
                    xtype: 'toolbar',
                    layout: {
                        type: 'hbox',
                        pack: 'center'
                    },
                    items: [
                    {
                        text: '确定',
                        handler: function () {
                            voteResultPanel.hide();
                        }
                    }]
                },
                {
                    xtype: 'dataview',
                    id: 'resultList',
                    baseCls: 'meeting',
                    items: [
                    {
                        xtype: 'panel',
                        docked: 'top',
                        layout: 'hbox',
                        items: [
                        {
                            baseCls: 'title',
                            style: 'width:60%',
                            html: '选项'
                        },
                        {
                            baseCls: 'title',
                            style: 'width:20%',
                            html: '投选人数'
                        },
                        {
                            baseCls: 'title',
                            style: 'width:20%',
                            html: '所占比例'
                        }]
                    }],
                    itemTpl: new Ext.XTemplate(
                    '<div style="width:60%">{Value}</div>',
                    '<div style="width:20%">{SelectedCount}</div>',
                    '<div style="width:20%">{SelectedPer}</div>'),
                    store: new Ext.data.Store({
                        model: 'Wiztop.model.VoteItem',
                        autoLoad: true
                    })
                }
                ]
                });
                Ext.Viewport.add(voteResultPanel);
                //获取投票结果
                Ext.data.JsonP.request({
                    url: commLib.Website + '/ashx/VoteHandler.ashx?method=getresult&voteId=' + record.raw.Id + "&meetingId=" + record.raw.MeetingId,
                    success: function (result, request) {
                        if (result.success) {
                            var store = Ext.getCmp('resultList').getStore();
                            store.removeAll();
                            store.setData(result.ResponseData);
                            voteResultPanel.show();
                        }
                        else {
                            Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                            return false;
                        }
                    }
                });
            }
        }
    },
    toTopicCollect: function () {
        //跳转到议题征集界面，如果是新增为一串0
        this.redirectTo('topiccollect/00000000-0000-0000-0000-000000000000')
    },
    history_itemtap: function (dataview, index, item, record, e) {
        //进入会议历史界面
        if (e.target.id == 'btnViewMeeting') {
            this.redirectTo('meetinghistorytopic/' + record.raw.Id);
        }
        else if (e.target.id == 'btnUpload') {
            //会议纪要
            //只有当前会议状态为4（关闭）或 2（激活）时，才能进入会议纪要界面
            if (record.raw.Status == 4 || record.raw.Status == 2) {
                this.redirectTo('summarycollect/' + record.raw.Id);
            }
            else {
                Ext.Msg.alert('提示', "当前会议并未结束，无法查看会议纪要！", Ext.emptyFn);
            }
        }
    },
    mySearch: function () {
        var title = "";
        //var title = this.getHMyTitle().getValue();
        //        var start = this.getHStart().getValue();
        //        var end = this.getHEnd().getValue();
        //alert(title + " " + start + " " + end);
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/MeetingHandler.ashx?method=getmy&employeeId=' + sessionStorage.UserId,
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getMyHistoryList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                    Ext.Viewport.unmask();
                }
                else {
                    Ext.Viewport.unmask();
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    toMeetingTopic: function () {
        this.getMyApproveView().setActiveItem(0);
        this.getSegTopic().setActiveItem(this.getBtnUnSign());
        this.getSegTopic().setPressedButtons([0]);
        this.unsign_tap();
    },
    toMeetingSummary: function () {
        this.getMyApproveView().setActiveItem(1);
        this.getSegSummary().setActiveItem(this.getBtnUnSignSummary());
        this.getSegSummary().setPressedButtons([0]);
        this.unSignSummary_tap();
    },
    unsign_tap: function () {
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/ApproveHandler.ashx?method=getun&employeeId=' + sessionStorage.UserId,
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getMyApproveList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                    Ext.Viewport.unmask();
                }
                else {
                    Ext.Viewport.unmask();
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    signed_tap: function () {
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/ApproveHandler.ashx?method=get&employeeId=' + sessionStorage.UserId,
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getMyApproveList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                }
                else {
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    unSignSummary_tap: function () {
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/MeetingHandler.ashx',
            params: {
                method: 'getunsign',
                employeeId: sessionStorage.UserId
            },
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getMySummaryList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                }
                else {
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    signedSummary_tap: function () {
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/MeetingHandler.ashx',
            params: {
                method: 'getsign',
                employeeId: sessionStorage.UserId
            },
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    var store = this.getMySummaryList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                }
                else {
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    video_itemtap: function (dataview, index, item, record, e) {
        var me = this;
        if (e.target.id == 'btnEnterVideo') {
            //进入视频
            window.open('iomeeting://' + commLib.VideoUrl + '/em.do?hostEmail=' + record.raw.HostEmail + '&hostPass=' + record.raw.HostPass + '&userName=' + sessionStorage.UserName);
        }
        else if (e.target.id == 'btnCloseVideo') {
            //删除当前视频会议

            Ext.Msg.confirm('提示', '确定关闭视频会议吗?', function (button) {
                if (button == 'yes') {
                    Ext.data.JsonP.request({
                        url: commLib.Website + '/ashx/MeetingHandler.ashx?method=delvideo&videoId=' + record.raw.Id,
                        success: function (result, request) {
                            if (result.success) {
                                me.getVideoList().getStore().removeAt(index);
                                Ext.Msg.alert('提示', '删除成功!');
                            }
                            else {
                                Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                            }
                        }
                    });
                }
            });
        }
    },
    getVideoMeeting: function () {
        var me = this;
        //赋值详细信息
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/MeetingHandler.ashx?method=getmyvideo&employeeId=' + sessionStorage.UserId,
            success: function (result, request) {
                if (result.success) {
                    Ext.Viewport.unmask();
                    var store = me.getVideoList().getStore();
                    store.removeAll();
                    store.setData(result.ResponseData);
                }
                else {
                    Ext.Viewport.unmask();
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            },
            failure: function (response) {
                Ext.Viewport.unmask();
                Ext.Msg.alert('提示', "远程服务器连接错误：" + response);
            }
        });
    },
    createVideo_tap: function () {
        var me = this;
        this.getMyVideoList().setActiveItem(1);
        Ext.Viewport.mask({ xtype: 'myloadmask', message: '检查可用视频会议室...' + commLib.loadingText });
        //首先检测是否有空闲的临时视频会议室可以使用
        Ext.data.JsonP.request({
            url: commLib.Website + '/ashx/MeetingHandler.ashx?method=gettempvideo',
            scope: this,
            success: function (result, request) {
                if (result.success) {
                    me.hostEmail = result.ResponseData.ItemArray[3];
                    me.hostPass = result.ResponseData.ItemArray[4];
                    //清空主题输入框
                    this.getTxtTitle().setValue('');
                    //获取OA人员
                    Ext.data.JsonP.request({
                        url: commLib.Website + '/ashx/MeetingHandler.ashx?method=getoauser',
                        success: function (result, request) {
                            if (result.success) {
                                var store = me.getEmployeeList().getStore();
                                store.removeAll();
                                store.setData(result.ResponseData);
                                Ext.Viewport.unmask();
                            }
                            else {
                                Ext.Viewport.unmask();
                                me.getMyVideoList().setActiveItem(0);
                                Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                                return false;
                            }
                        }
                    });
                }
                else {
                    Ext.Viewport.unmask();
                    me.getMyVideoList().setActiveItem(0);
                    Ext.Msg.alert('错误', result.Message, Ext.emptyFn);
                    return false;
                }
            }
        });
    },
    saveVideo_tap: function () {
        var me = this;
        var title = me.getTxtTitle().getValue();
        if (title == "") {
            Ext.Msg.alert('提示', '请输入会议主题！', Ext.emptyFn);
            return;
        }
        var empLength = me.getEmployeeList().getSelectionCount();
        if (empLength == 0) {
            Ext.Msg.alert('提示', '请选择参会人员！', Ext.emptyFn);
            return;
        }

        var meetingJson = '{"RoleId":"' + sessionStorage.RoleId + '","EmployeeId":"' + sessionStorage.UserId + '","EmployeeName":"' + sessionStorage.UserName + '","EmployeeTitle":"' + sessionStorage.UserTitle + '","Title":"' + title + '"';
        meetingJson += ',"HostEmail":"' + me.hostEmail + '","HostPass":"' + me.hostPass + '"}';
        var empJson = "[";
        Ext.each(me.getEmployeeList().getSelection(), function (rec) {
            empJson = empJson + '{"EmployeeId":"' + rec.raw.account + '","EmployeeName":"' + rec.raw.name + '","EmployeeTitle":"' + rec.raw.title + '","RoleId":"' + rec.raw.roleId + '","Mobile":"' + rec.raw.mobile + '"},';
        });
        if (empLength > 0) {
            empJson = empJson.substring(0, empJson.length - 1);
        }
        empJson = empJson + "]";
        Ext.Viewport.mask({ xtype: 'myloadmask', message: '保存中...' + commLib.loadingText });
        $.post(commLib.Website + '/ashx/MeetingHandler.ashx?method=savevideomeeting', { meeting: meetingJson, employees: empJson }, function (data) {
            if (data.success == true) {
                me.getMyVideoList().setActiveItem(0);
                me.getVideoMeeting();
            } else {
                Ext.Viewport.unmask();
                Ext.Msg.alert('错误', data.Message, Ext.emptyFn);
            }
        });
    },
    cancelVideo_tap: function () {
        this.getMyVideoList().setActiveItem(0);
    }
})